!
function(e, t, n) {
    function i(e, t) {
        return typeof e === t
    }
    function a() {
        var e, t, n, a, o, r, s;
        for (var c in b) if (b.hasOwnProperty(c)) {
            if (e = [], t = b[c], t.name && (e.push(t.name.toLowerCase()), t.options && t.options.aliases && t.options.aliases.length)) for (n = 0; n < t.options.aliases.length; n++) e.push(t.options.aliases[n].toLowerCase());
            for (a = i(t.fn, "function") ? t.fn() : t.fn, o = 0; o < e.length; o++) r = e[o],
            s = r.split("."),
            1 === s.length ? C[s[0]] = a: (!C[s[0]] || C[s[0]] instanceof Boolean || (C[s[0]] = new Boolean(C[s[0]])), C[s[0]][s[1]] = a),
            w.push((a ? "": "no-") + s.join("-"))
        }
    }
    function o(e) {
        var t = T.className,
        n = C._config.classPrefix || "";
        if (y && (t = t.baseVal), C._config.enableJSClass) {
            var i = new RegExp("(^|\\s)" + n + "no-js(\\s|$)");
            t = t.replace(i, "$1" + n + "js$2")
        }
        C._config.enableClasses && (t += " " + n + e.join(" " + n), y ? T.className.baseVal = t: T.className = t)
    }
    function r() {
        return "function" != typeof t.createElement ? t.createElement(arguments[0]) : y ? t.createElementNS.call(t, "", arguments[0]) : t.createElement.apply(t, arguments)
    }
    function s(e) {
        return e.replace(/([a-z])-([a-z])/g,
        function(e, t, n) {
            return t + n.toUpperCase()
        }).replace(/^-/, "")
    }
    function c(e, t) {
        return !! ~ ("" + e).indexOf(t)
    }
    function l() {
        var e = t.body;
        return e || (e = r(y ? "svg": "body"), e.fake = !0),
        e
    }
    function u(e, n, i, a) {
        var o, s, c, u, d = "modernizr",
        f = r("div"),
        m = l();
        if (parseInt(i, 10)) for (; i--;) c = r("div"),
        c.id = a ? a[i] : d + (i + 1),
        f.appendChild(c);
        return o = r("style"),
        o.type = "text/css",
        o.id = "s" + d,
        (m.fake ? m: f).appendChild(o),
        m.appendChild(f),
        o.styleSheet ? o.styleSheet.cssText = e: o.appendChild(t.createTextNode(e)),
        f.id = d,
        m.fake && (m.style.background = "", m.style.overflow = "hidden", u = T.style.overflow, T.style.overflow = "hidden", T.appendChild(m)),
        s = n(f, e),
        m.fake ? (m.parentNode.removeChild(m), T.style.overflow = u, T.offsetHeight) : f.parentNode.removeChild(f),
        !!s
    }
    function d(e) {
        return e.replace(/([A-Z])/g,
        function(e, t) {
            return "-" + t.toLowerCase()
        }).replace(/^ms-/, "-ms-")
    }
    function f(t, i) {
        var a = t.length;
        if ("CSS" in e && "supports" in e.CSS) {
            for (; a--;) if (e.CSS.supports(d(t[a]), i)) return ! 0;
            return ! 1
        }
        if ("CSSSupportsRule" in e) {
            for (var o = []; a--;) o.push("(" + d(t[a]) + ":" + i + ")");
            return o = o.join(" or "),
            u("@supports (" + o + ") { #modernizr { position: absolute; } }",
            function(e) {
                return "absolute" == getComputedStyle(e, null).position
            })
        }
        return n
    }
    function m(e, t, a, o) {
        function l() {
            d && (delete E.style, delete E.modElem)
        }
        if (o = i(o, "undefined") ? !1 : o, !i(a, "undefined")) {
            var u = f(e, a);
            if (!i(u, "undefined")) return u
        }
        for (var d, m, p, v, g, h = ["modernizr", "tspan"]; ! E.style;) d = !0,
        E.modElem = r(h.shift()),
        E.style = E.modElem.style;
        for (p = e.length, m = 0; p > m; m++) if (v = e[m], g = E.style[v], c(v, "-") && (v = s(v)), E.style[v] !== n) {
            if (o || i(a, "undefined")) return l(),
            "pfx" == t ? v: !0;
            try {
                E.style[v] = a
            } catch(w) {}
            if (E.style[v] != g) return l(),
            "pfx" == t ? v: !0
        }
        return l(),
        !1
    }
    function p(e, t) {
        return function() {
            return e.apply(t, arguments)
        }
    }
    function v(e, t, n) {
        var a;
        for (var o in e) if (e[o] in t) return n === !1 ? e[o] : (a = t[e[o]], i(a, "function") ? p(a, n || t) : a);
        return ! 1
    }
    function g(e, t, n, a, o) {
        var r = e.charAt(0).toUpperCase() + e.slice(1),
        s = (e + " " + A.join(r + " ") + r).split(" ");
        return i(t, "string") || i(t, "undefined") ? m(s, t, a, o) : (s = (e + " " + M.join(r + " ") + r).split(" "), v(s, t, n))
    }
    function h(e, t, i) {
        return g(e, n, n, t, i)
    }
    var w = [],
    b = [],
    $ = {
        _version: "3.2.0",
        _config: {
            classPrefix: "",
            enableClasses: !0,
            enableJSClass: !0,
            usePrefixes: !0
        },
        _q: [],
        on: function(e, t) {
            var n = this;
            setTimeout(function() {
                t(n[e])
            },
            0)
        },
        addTest: function(e, t, n) {
            b.push({
                name: e,
                fn: t,
                options: n
            })
        },
        addAsyncTest: function(e) {
            b.push({
                name: null,
                fn: e
            })
        }
    },
    C = function() {};
    C.prototype = $,
    C = new C;
    var S = $._config.usePrefixes ? " -webkit- -moz- -o- -ms- ".split(" ") : [];
    $._prefixes = S;
    var T = t.documentElement,
    y = "svg" === T.nodeName.toLowerCase();
    y || !
    function(e, t) {
        function n(e, t) {
            var n = e.createElement("p"),
            i = e.getElementsByTagName("head")[0] || e.documentElement;
            return n.innerHTML = "x<style>" + t + "</style>",
            i.insertBefore(n.lastChild, i.firstChild)
        }
        function i() {
            var e = b.elements;
            return "string" == typeof e ? e.split(" ") : e
        }
        function a(e, t) {
            var n = b.elements;
            "string" != typeof n && (n = n.join(" ")),
            "string" != typeof e && (e = e.join(" ")),
            b.elements = n + " " + e,
            l(t)
        }
        function o(e) {
            var t = w[e[g]];
            return t || (t = {},
            h++, e[g] = h, w[h] = t),
            t
        }
        function r(e, n, i) {
            if (n || (n = t), d) return n.createElement(e);
            i || (i = o(n));
            var a;
            return a = i.cache[e] ? i.cache[e].cloneNode() : v.test(e) ? (i.cache[e] = i.createElem(e)).cloneNode() : i.createElem(e),
            !a.canHaveChildren || p.test(e) || a.tagUrn ? a: i.frag.appendChild(a)
        }
        function s(e, n) {
            if (e || (e = t), d) return e.createDocumentFragment();
            n = n || o(e);
            for (var a = n.frag.cloneNode(), r = 0, s = i(), c = s.length; c > r; r++) a.createElement(s[r]);
            return a
        }
        function c(e, t) {
            t.cache || (t.cache = {},
            t.createElem = e.createElement, t.createFrag = e.createDocumentFragment, t.frag = t.createFrag()),
            e.createElement = function(n) {
                return b.shivMethods ? r(n, e, t) : t.createElem(n)
            },
            e.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + i().join().replace(/[\w\-:]+/g,
            function(e) {
                return t.createElem(e),
                t.frag.createElement(e),
                'c("' + e + '")'
            }) + ");return n}")(b, t.frag)
        }
        function l(e) {
            e || (e = t);
            var i = o(e);
            return ! b.shivCSS || u || i.hasCSS || (i.hasCSS = !!n(e, "article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),
            d || c(e, i),
            e
        }
        var u, d, f = "3.7.3",
        m = e.html5 || {},
        p = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,
        v = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,
        g = "_html5shiv",
        h = 0,
        w = {}; !
        function() {
            try {
                var e = t.createElement("a");
                e.innerHTML = "<xyz></xyz>",
                u = "hidden" in e,
                d = 1 == e.childNodes.length ||
                function() {
                    t.createElement("a");
                    var e = t.createDocumentFragment();
                    return "undefined" == typeof e.cloneNode || "undefined" == typeof e.createDocumentFragment || "undefined" == typeof e.createElement
                } ()
            } catch(n) {
                u = !0,
                d = !0
            }
        } ();
        var b = {
            elements: m.elements || "abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",
            version: f,
            shivCSS: m.shivCSS !== !1,
            supportsUnknownElements: d,
            shivMethods: m.shivMethods !== !1,
            type: "default",
            shivDocument: l,
            createElement: r,
            createDocumentFragment: s,
            addElements: a
        };
        e.html5 = b,
        l(t),
        "object" == typeof module && module.exports && (module.exports = b)
    } ("undefined" != typeof e ? e: this, t);
    var x = "Moz O ms Webkit",
    M = $._config.usePrefixes ? x.toLowerCase().split(" ") : [];
    $._domPrefixes = M,
    C.addTest("cssgradients",
    function() {
        for (var e, t = "background-image:",
        n = "gradient(linear,left top,right bottom,from(#9f9),to(white));",
        i = "",
        a = 0,
        o = S.length - 1; o > a; a++) e = 0 === a ? "to ": "",
        i += t + S[a] + "linear-gradient(" + e + "left top, #9f9, white);";
        C._config.usePrefixes && (i += t + "-webkit-" + n);
        var s = r("a"),
        c = s.style;
        return c.cssText = i,
        ("" + c.backgroundImage).indexOf("gradient") > -1
    }),
    C.addTest("opacity",
    function() {
        var e = r("a").style;
        return e.cssText = S.join("opacity:.55;"),
        /^0.55$/.test(e.opacity)
    });
    var k = "CSS" in e && "supports" in e.CSS,
    P = "supportsCSS" in e;
    C.addTest("supports", k || P);
    var I = $.testStyles = u,
    A = $._config.usePrefixes ? x.split(" ") : [];
    $._cssomPrefixes = A;
    var O = {
        elem: r("modernizr")
    };
    C._q.push(function() {
        delete O.elem
    });
    var E = {
        style: O.elem.style
    };
    C._q.unshift(function() {
        delete E.style
    });
    $.testProp = function(e, t, i) {
        return m([e], n, t, i)
    };
    $.testAllProps = g,
    $.testAllProps = h,
    C.addTest("csstransforms3d",
    function() {
        var e = !!h("perspective", "1px", !0),
        t = C._config.usePrefixes;
        if (e && (!t || "webkitPerspective" in T.style)) {
            var n, i = "#modernizr{width:0;height:0}";
            C.supports ? n = "@supports (perspective: 1px)": (n = "@media (transform-3d)", t && (n += ",(-webkit-transform-3d)")),
            n += "{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",
            I(i + n,
            function(t) {
                e = 7 === t.offsetWidth && 18 === t.offsetHeight
            })
        }
        return e
    }),
    a(),
    o(w),
    delete $.addTest,
    delete $.addAsyncTest;
    for (var U = 0; U < C._q.length; U++) C._q[U]();
    e.Modernizr = C
} (window, document),
function(e) {
    function t() {
        e(document).mousemove(function(e) {
            v.x = e.pageX,
            v.y = e.pageY
        })
    }
    function n(e, t) {
        setTimeout(function() {
            return e.speed = .99 * e.speed,
            e.distance += e.speed,
            e.speed > 6 && (e.speed = 6),
            e.speed < -6 && (e.speed = -6),
            e.dragging ? void(e.speed = 0) : (requestAnimationFrame(function() {
                t(e)
            }), void(Math.abs(e.speed) < .1 ? e.speed = 0 : n(e, t)))
        },
        1e3 / 60)
    }
    function i(e) {
        var t = "";
        10 > e ? t = "00" + e: 100 > e ? t = "0" + e: 1e3 > e && (t = e);
        var n = window.devicePixelRatio || 1,
        i = "";
        if (n > 1.5) var a = i + t + "@2x.jpg";
        else var a = i + t + ".jpg";
        return a
    }
    function a(e) {
        for (var t = 0,
        n = 0; n < e.totalFrames; n++) e.image[n] = new Image,
        e.image[n].onload = function() {
            t++,
            359 == t && e.context.drawImage(e.image[e.orignAngle], 0, 0, e.canvas.width, e.canvas.height)
        },
        e.image[n].src = i(n)
    }
    function o(e, t, n) {
        return e.startImage = new Image,
        e.startImage.onload = function() {
            e.context.drawImage(e.startImage, 0, 0, e.canvas.width, e.canvas.height)
        },
        e.startImage.src = i(t),
        e.startImage
    }
    function r(e) {
        e.dragging && setTimeout(function() {
            e.pointerEndPosX = e.pointerStartPosX,
            e.pointerStartPosX = v.x;
            var t = 1 * (e.pointerStartPosX - e.pointerEndPosX);
            0 !== e.speed && 0 === t && (t = e.speed / 2),
            e.speed = t,
            r(e)
        },
        e.frameTime)
    }
    function s(e) {
        e.distance = 0,
        n(e,
        function(t) {
            if (!e.dragging) {
                var n = c(t);
                u(e, n)
            }
        })
    }
    function c(e) {
        var t = 0;
        t = e.distance < 0 ? Math.floor(e.distance) : Math.ceil(e.distance);
        var n = (e.orignAngle + t) % 360;
        return 0 > n ? n + 360 : n
    }
    function l(e) {
        if (e.dragging) {
            var t = v.x;
            e.distance = t - e.orignPointerPosX;
            var n = c(e);
        }
    }
    function f(n) {
        n.$container.on("mousedown",
        function(i) {
            i.preventDefault(),
            n.$container.addClass("grabbing"),
            e(n.$container.parent()[0]).addClass("grabbing"),
            t(),
            n.orignAngle = n.curAngle,
            n.pointerStartPosX = v.x,
            n.orignPointerPosX = v.x,
            n.dragging = !0,
            r(n)
        }),
        p.on("spin.mouseup",
        function(t) {
            n.dragging && (n.orignAngle = n.curAngle, n.dragging = !1, s(n), n.$container.removeClass("grabbing"), e(n.$container.parent()[0]).removeClass("grabbing"))
        }),
        p.on("spin.mousemove",
        function(e) {
            n.dragging && (e.preventDefault(), l(n))
        }),
        p.on("mouseup",
        function(e) {
            p.trigger("spin.mouseup")
        }),
        p.on("mousemove",
        function(e) {
            p.trigger("spin.mousemove")
        })
    }
    function m(e) {
        e.dragging || (e.dragging = !0, setTimeout(function() {
            e.dragging = !1
        },
        300))
    }
    var p = e(document),
    v = {
        x: -1,
        y: -1
    },
    g = function(e) {
        var t = window.devicePixelRatio || 1,
        n = e.context.webkitBackingStorePixelRatio || e.context.mozBackingStorePixelRatio || e.context.msBackingStorePixelRatio || e.context.oBackingStorePixelRatio || e.context.backingStorePixelRatio || 1;
        return t / n
    };
    e.fn.spin = function(e) {
        var t = {};
        return t.canvas = document.createElement("canvas"),
        t.context = t.canvas.getContext("2d"),
        t.pixelRatio = g(t),
        t.fullHeight = 38,
        t.fullWidth = 720,
        1 != t.pixelRatio ? (t.fullHeight *= t.pixelRatio, t.fullWidth *= t.pixelRatio, t.canvas.height = t.fullHeight, t.canvas.width = t.fullWidth) : (t.canvas.height = t.fullHeight, t.canvas.width = t.fullWidth),
        this.append(t.canvas),
        t.image = [],
        t.dragging = !1,
        t.pointerStartPosX = 0,
        t.pointerEndPosX = 0,
        t.pointerDistance = 0,
        t.totalFrames = 360,
        t.currentFrame = 0,
        t.speed = 0,
        t.frameTime = 1e3 / 60,
        t.orignPointerPosX = 0,
        t.orignAngle = e || 0,
        t.curAngle = t.orignAngle || 0,
        t.$container = this,
        this.spin = t,
        o(t, e),
        f(t),
        {
            option: t,
            loadImage: function() {
                a(this.option)
            },
            spinPause: function() {
                m(this.option)
            },
            unbind: function() {
                p.off("spin.mousemove"),
                p.off("spin.mouseup")
            }
        }
    }
} (window.jQuery),
function(e) {
    var t = {
        sectionContainer: "section",
        headerContainer: ".header",
        footerContainer: ".footer",
        wrapperClass: "onepage-wrapper",
        subNavClass: ".onepage-nav",
        paginationContainer: "onepage-pagination",
        paginationTemplate: ["<li>", '<span class="outer-ring"></span>', '<span class="inner-ring"></span>', '<span class="page-title"></span>', "</li>"].join(""),
        hasPagination: !0,
        paginationTip: [""],
        easing: "cubic-bezier(.86, 0, .07, 1)",
        desktopAnimationTime: 1e3,
        mobileAnimationTime: 400,
        beforeMove: null,
        afterMove: null,
        minHeight: 620
    },
    n = function() {
        return e(window).width() <= 736 && (screen.width <= 736 || window.devicePixelRatio >= 2)
    },
    i = function() {
        return ! e("html").hasClass("csstransforms3d")
    },
    a = function(e, t, n, i, a) {
        a = a || "transform";
        var o = a;
        "transform" == a && (o = "-webkit-transform"),
        t += "px",
        e.css({
            "-webkit-transform": "translate3d(0, " + t + ", 0)",
            "-webkit-transition": o + " " + n + "ms " + i,
            transform: "translate3d(0, " + t + ", 0)",
            transition: a + " " + n + "ms " + i
        })
    };
    e.fn.pageScroll = function(o) {
        var r = e(this),
        s = {},
        c = !1,
        l = 0,
        u = 0,
        d = 0,
        f = !1,
        m = !1,
        p = e.extend({},
        t, o);
        p.animationTime = n() ? p.mobileAnimationTime: p.desktopAnimationTime;
        var v = function() {
            s = {
                header: e(p.headerContainer),
                footer: e(p.footerContainer),
                section: e(p.sectionContainer),
                pagination: e("." + p.paginationContainer),
                subNav: e(p.subNavClass),
                _window: e(window)
            },
            c = s.header.size() > 0 && s.footer.size() > 0,
            u = c ? 0 : 1
        },
        g = function(t) {
            e.extend(p, t)
        };
        e.fn.swipeEvents = function() {
            function t(t) {
                if ("a" != t.target.tagName.toLowerCase() || !e(t.target).parents(p.headerContainer).length) {
                    var i = t.originalEvent,
                    a = P(i);
                    a.y && (h = a.x, w = a.y, y = (new Date).getTime(), S = setTimeout(function() {
                        k.on("touchmove pointermove MSPointerMove", n)
                    },
                    300), t.preventDefault())
                }
            }
            function n(e) {
                var t = e.originalEvent,
                n = P(t);
                if (n.y) {
                    e.preventDefault(),
                    $ = h - n.x,
                    C = w - n.y,
                    c ? 0 == u ? (C = (1 - .82 * Math.abs(C) / x) * C, C = -M >= C ? -(M - 1e-6) : C) : u == s.section.length + 1 && (C = (1 - .82 * Math.abs(C) / x) * C, C = C >= M ? M - 1e-6: C) : 1 == u && 0 > C ? (C = (1 - .82 * Math.abs(C) / x) * C, C = -M >= C ? -(M - 1e-6) : C) : u == s.section.length && C > 0 && (C = (1 - .82 * Math.abs(C) / x) * C, C = C >= M ? M - 1e-6: C);
                    var i = -C / 2 + d;
                    f || (a(r, i, 0, "linear"), b.toggle(u, i, 0, "linear", 1)),
                    (n.y < 0 || w >= x - 10) && m()
                }
            }
            function i(e) {
                var t = e.originalEvent,
                n = P(t);
                0 == C && (C = w - n.y),
                "number" == typeof C && m()
            }
            function o() {
                if (Math.abs(C) < M) {
                    var e = p.animationTime / 2;
                    a(r, d, e, "cubic-bezier(0.455, 0.03, 0.515, 0.955)"),
                    b.toggle(u, d, e, "cubic-bezier(0.455, 0.03, 0.515, 0.955)", 1)
                }
                clearTimeout(S),
                k.off("touchmove pointermove MSPointerMove", n)
            }
            function l(e) {
                o()
            }
            function m() {
                var e = (new Date).getTime(),
                t = 300 > e - y;
                $ >= 50 || $ > 14 && t ? k.trigger("swipeLeft") : ( - 50 >= $ || -14 > $ && t) && k.trigger("swipeRight"),
                C >= 50 || C > 14 && t ? k.trigger("swipeUp") : ( - 50 >= C || -14 > C && t) && k.trigger("swipeDown"),
                o(),
                $ = 0,
                C = 0
            }
            function v() {
                k.on("touchstart pointerdown MSPointerDown", t),
                k.on("touchend pointerup MSPointerUp", i),
                k.on("touchcancel pointercancel MSPointerCancel", l),
                k.on("swipeDown",
                function(e) {
                    T(e, 1)
                }).on("swipeUp",
                function(e) {
                    T(e, -1)
                })
            }
            function g() {
                k.off("touchstart pointerdown MSPointerDown", t),
                k.off("touchend pointerup MSPointerUp", i),
                k.off("touchcancel pointercancel MSPointerCancel", l),
                k.off("swipeDown swipeUp")
            }
            var h, w, $, C, S, y, x = e(window).height(),
            M = .25 * x,
            k = e(this),
            P = function(e) {
                var t = {};
                return window.navigator.pointerEnabled && "touch" == e.pointerType || window.navigator.msPointerEnabled && e.pointerType && e.pointerType == e.MSPOINTER_TYPE_TOUCH ? (t.y = e.pageY, t.x = e.pageX) : e.changedTouches && e.changedTouches.length && (t.y = e.changedTouches[0].pageY, t.x = e.changedTouches[0].pageX),
                t
            };
            return {
                addTouchListner: v,
                removeTouchListner: g
            }
        };
        var h, w = {
            init: function() {
                var t = this;
                if (p.hasPagination) {
                    if (s.pagination.length < 1) {
                        e('<ul class="' + p.paginationContainer + '"></ul>').insertAfter(r),
                        s.pagination = e("ul." + p.paginationContainer),
                        sectionLength = s.section.length;
                        for (var n = 0; n < sectionLength; n++) {
                            var i = p.paginationTip[n] || "";
                            e(p.paginationTemplate).appendTo(s.pagination).find(".page-title").text(i)
                        }
                    }
                    t.toggleActive(),
                    t.addListener()
                }
            },
            remove: function() {
                s.pagination && s.pagination.remove()
            },
            show: function() {
                s.pagination.removeClass("hidden")
            },
            hide: function() {
                s.pagination.addClass("hidden")
            },
            toggleActive: function() {
                var e = u - 1,
                t = this;
                0 > e && (e = 0),
                0 == u || u > s.section.length ? t.hide() : t.show(),
                s.pagination.find("li").removeClass("active"),
                s.pagination.find("li").eq(e).addClass("active")
            },
            addListener: function() {
                s.pagination.on("click",
                function(t) {
                    for (var n = t.target; e(n).parents("li").length;) n = n.parentNode;
                    if ("li" == n.tagName.toLowerCase() && !e(this).hasClass("active")) {
                        var i = -(e(n).index() + 1 - u);
                        0 !== i && k(i)
                    }
                })
            }
        },
        b = {
            toggle: function(e, t, n, i, o) {
                var r = this;
                if (r.bgSwitch(e, o), 0 === e && c) r.hide();
                else {
                    r.show();
                    var l = -(t + s.header.height());
                    a(s.subNav, l, n, i, "all")
                }
            },
            bgSwitch: function(e, t) {
                var n;
                n = 0 == e ? s.section.eq(0).attr("data-background") : s.section.eq(e - 1).attr("data-background"),
                "dark" == n ? s.subNav.addClass("header-dark") : s.subNav.removeClass("header-dark"),
                e && (s.subNav.removeClass("slide-up").removeClass("slide-down"), t > 0 ? s.subNav.addClass("slide-down") : s.subNav.addClass("slide-up"))
            },
            show: function() {
                s.subNav.addClass("active")
            },
            hide: function() {
                s.subNav.removeAttr("style"),
                s.subNav.removeClass("active")
            }
        },
        $ = {
            resizeTimer: 0,
            init: function() {
                var e = this;
                e.prepare(),
                e.resize(),
                c || s.section.eq(0).addClass("active")
            },
            reset: function() {
                m = !1,
                v(),
                w.remove(),
                s.subNav.removeClass("header-dark"),
                b.hide(),
                r.removeAttr("style"),
                s.section.removeAttr("style"),
                e("html").removeClass(p.wrapperClass),
                e("html, body").removeClass("hidden vertical-hidden"),
                y.off(),
                e(document).off("mousedown", M),
                I.removeTouchListner(),
                e(document).off("keydown", x),
                clearTimeout(h)
            },
            resize: function() {
                var e = $;
                if (P()) if (m) {
                    var t = s._window.height();
                    s.section.height(t),
                    S(),
                    a(r, d, 0, "linear"),
                    b.toggle(u, d, 0, "linear", 1)
                } else E();
                else e.reset()
            },
            resizeHandler: function() {
                var e = 250,
                t = $;
                clearTimeout(t.resizeTimer),
                t.resizeTimer = setTimeout(function() {
                    t.resize()
                },
                e)
            },
            prepare: function() {
                for (var e = s.section.length,
                t = 0; e > t; t++) {
                    var n = s.section[t],
                    i = c && 0 === t ? 0 : p.animationTime / 3;
                    n.timer = i
                }
            },
            toggleActive: function(t, n) {
                var i = t - 1,
                a = s.section[i],
                o = s.section.length;
                n > 0 && a == s.section[o - 1] || e(a).removeClass("active"),
                a && setTimeout(function() {
                    e(a).addClass("active"),
                    e(a).addClass("played")
                },
                a.timer),
                e(a).removeClass("slide-up").removeClass("slide-down"),
                n > 0 ? e(a).addClass("slide-down") : e(a).addClass("slide-up")
            }
        },
        C = function(e) {
            var t = c ? s.section.length + 2 : s.section.length;
            l = u,
            0 > e ? u += Math.abs(e) : u -= Math.abs(e),
            u = Math.min(u, t - 1),
            u = Math.max(u, 0)
        },
        S = function() {
            var e = s.header.height(),
            t = s.footer.height(),
            n = s._window.height();
            switch (u) {
            case 0:
                d = 0;
                break;
            case s.section.length + 1 : d = -1 * ((u - 2) * n + e + t);
                break;
            default:
                d = -1 * ((u - 1) * n + e)
            }
        },
        T = function(e, t) {
            if (e.preventDefault(), !t) {
                var n = e.originalEvent;
                t = "undefined" != typeof n.wheelDeltaY ? n.wheelDeltaY: n.wheelDelta || -n.detail
            }
            0 !== t && (t = t > 0 ? 1 : -1, k(t))
        },
        y = {
            on: function() {
                e(document).on("mousewheel DOMMouseScroll", T)
            },
            off: function() {
                e(document).off("mousewheel DOMMouseScroll", T)
            }
        },
        x = function(e) {
            e.target.tagName.toLowerCase();
            if ("input" != y && "textarea" != y) switch (e.which) {
            case 38:
                k(1);
                break;
            case 40:
                k( - 1);
                break;
            case 32:
                k( - 1);
                break;
            case 33:
                k(1);
                break;
            case 34:
                k( - 1)
            }
        },
        M = function(e) {
            return 2 == e.which ? !1 : void 0
        },
        k = function(e) {
            f || (f = !0, y.off(), h = setTimeout(function() {
                f = !1,
                y.on()
            },
            p.animationTime + 500), C(e), r.transformPage(p, l, u, e))
        };
        e.fn.transformPage = function(t, n, i, o) {
            if (n != i) {
                var l = t.easing,
                u = t.animationTime;
                c && (0 === i || 1 === i && 0 > o) && (l = "cubic-bezier(.165, .84, .44, 1)"),
                "function" == typeof t.beforeMove && t.beforeMove(i, u, l, o),
                S(),
                a(r, d, u, l),
                b.toggle(i, d, u, l, o),
                e(this).on("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",
                function(n) {
                    var a = n.target;
                    a == e(this)[0] && "function" == typeof t.afterMove && (s.subNav.removeClass("slide-up").removeClass("slide-down"), t.afterMove(i, u, l, o), e(this).off("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend"))
                }),
                $.toggleActive(i, o),
                w.toggleActive()
            }
        };
        var P = function() {
            var e = !1;
            return e = s._window.height() >= p.minHeight
        },
        I = r.swipeEvents(),
        A = function() {
            $.reset(),
            e(window).off("resize", $.resizeHandler)
        },
        O = function() {
            e("html").addClass(p.wrapperClass),
            navigator.userAgent.indexOf("Mac") > 0 ? e("html, body").addClass("hidden") : e("html, body").addClass("vertical-hidden"),
            e("html,body").animate({
                scrollTop: 0
            },
            {
                queue: !1
            },
            10),
            $.init(),
            w.init(),
            y.on(),
            e(document).on("mousedown", M),
            I.addTouchListner(),
            e(window).on("resize", $.resizeHandler),
            e(document).on("keydown", x)
        },
        E = function() {
            return i() ? void e(p.sectionContainer).addClass("active") : (v(), void(P() && (m = !0, O())))
        };
        return {
            setOptions: g,
            reset: A,
            init: E
        }
    }
} (window.jQuery),
function(e, t, n) {
    "use strict";
    var i = {
        timeout: 5
    };
    t.fn.blockImages = function(n) {
        var a = t.extend({},
        i, n),
        o = a.timeout,
        r = !0,
        s = !1,
        c = function() {
            r && setTimeout(function() {
                t("body").removeClass("blockimages"),
                r = !1
            },
            0)
        },
        l = function() {
            s ? setTimeout(c, 100 * o) : (s = !0, t(e).on("load",
            function(e) {
                c()
            }), setTimeout(c, 1e3 * o))
        },
        u = function() {
            r = !0,
            t("body").addClass("blockimages")
        };
        return {
            start: l,
            init: u
        }
    }
} (window, jQuery),
jQuery.easing.jswing = jQuery.easing.swing,
jQuery.extend(jQuery.easing, {
    def: "easeOutQuad",
    swing: function(e, t, n, i, a) {
        return jQuery.easing[jQuery.easing.def](e, t, n, i, a)
    },
    easeInQuad: function(e, t, n, i, a) {
        return i * (t /= a) * t + n
    },
    easeOutQuad: function(e, t, n, i, a) {
        return - i * (t /= a) * (t - 2) + n
    },
    easeInOutQuad: function(e, t, n, i, a) {
        return (t /= a / 2) < 1 ? i / 2 * t * t + n: -i / 2 * (--t * (t - 2) - 1) + n
    },
    easeInCubic: function(e, t, n, i, a) {
        return i * (t /= a) * t * t + n
    },
    easeOutCubic: function(e, t, n, i, a) {
        return i * ((t = t / a - 1) * t * t + 1) + n
    },
    easeInOutCubic: function(e, t, n, i, a) {
        return (t /= a / 2) < 1 ? i / 2 * t * t * t + n: i / 2 * ((t -= 2) * t * t + 2) + n
    },
    easeInQuart: function(e, t, n, i, a) {
        return i * (t /= a) * t * t * t + n
    },
    easeOutQuart: function(e, t, n, i, a) {
        return - i * ((t = t / a - 1) * t * t * t - 1) + n
    },
    easeInOutQuart: function(e, t, n, i, a) {
        return (t /= a / 2) < 1 ? i / 2 * t * t * t * t + n: -i / 2 * ((t -= 2) * t * t * t - 2) + n
    },
    easeInQuint: function(e, t, n, i, a) {
        return i * (t /= a) * t * t * t * t + n
    },
    easeOutQuint: function(e, t, n, i, a) {
        return i * ((t = t / a - 1) * t * t * t * t + 1) + n
    },
    easeInOutQuint: function(e, t, n, i, a) {
        return (t /= a / 2) < 1 ? i / 2 * t * t * t * t * t + n: i / 2 * ((t -= 2) * t * t * t * t + 2) + n
    },
    easeInSine: function(e, t, n, i, a) {
        return - i * Math.cos(t / a * (Math.PI / 2)) + i + n
    },
    easeOutSine: function(e, t, n, i, a) {
        return i * Math.sin(t / a * (Math.PI / 2)) + n
    },
    easeInOutSine: function(e, t, n, i, a) {
        return - i / 2 * (Math.cos(Math.PI * t / a) - 1) + n
    },
    easeInExpo: function(e, t, n, i, a) {
        return 0 == t ? n: i * Math.pow(2, 10 * (t / a - 1)) + n
    },
    easeOutExpo: function(e, t, n, i, a) {
        return t == a ? n + i: i * ( - Math.pow(2, -10 * t / a) + 1) + n
    },
    easeInOutExpo: function(e, t, n, i, a) {
        return 0 == t ? n: t == a ? n + i: (t /= a / 2) < 1 ? i / 2 * Math.pow(2, 10 * (t - 1)) + n: i / 2 * ( - Math.pow(2, -10 * --t) + 2) + n
    },
    easeInCirc: function(e, t, n, i, a) {
        return - i * (Math.sqrt(1 - (t /= a) * t) - 1) + n
    },
    easeOutCirc: function(e, t, n, i, a) {
        return i * Math.sqrt(1 - (t = t / a - 1) * t) + n
    },
    easeInOutCirc: function(e, t, n, i, a) {
        return (t /= a / 2) < 1 ? -i / 2 * (Math.sqrt(1 - t * t) - 1) + n: i / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + n
    },
    easeInElastic: function(e, t, n, i, a) {
        var o = 1.70158,
        r = 0,
        s = i;
        if (0 == t) return n;
        if (1 == (t /= a)) return n + i;
        if (r || (r = .3 * a), s < Math.abs(i)) {
            s = i;
            var o = r / 4
        } else var o = r / (2 * Math.PI) * Math.asin(i / s);
        return - (s * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * a - o) * (2 * Math.PI) / r)) + n
    },
    easeOutElastic: function(e, t, n, i, a) {
        var o = 1.70158,
        r = 0,
        s = i;
        if (0 == t) return n;
        if (1 == (t /= a)) return n + i;
        if (r || (r = .3 * a), s < Math.abs(i)) {
            s = i;
            var o = r / 4
        } else var o = r / (2 * Math.PI) * Math.asin(i / s);
        return s * Math.pow(2, -10 * t) * Math.sin((t * a - o) * (2 * Math.PI) / r) + i + n
    },
    easeInOutElastic: function(e, t, n, i, a) {
        var o = 1.70158,
        r = 0,
        s = i;
        if (0 == t) return n;
        if (2 == (t /= a / 2)) return n + i;
        if (r || (r = a * (.3 * 1.5)), s < Math.abs(i)) {
            s = i;
            var o = r / 4
        } else var o = r / (2 * Math.PI) * Math.asin(i / s);
        return 1 > t ? -.5 * (s * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * a - o) * (2 * Math.PI) / r)) + n: s * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * a - o) * (2 * Math.PI) / r) * .5 + i + n
    },
    easeInBack: function(e, t, n, i, a, o) {
        return void 0 == o && (o = 1.70158),
        i * (t /= a) * t * ((o + 1) * t - o) + n
    },
    easeOutBack: function(e, t, n, i, a, o) {
        return void 0 == o && (o = 1.70158),
        i * ((t = t / a - 1) * t * ((o + 1) * t + o) + 1) + n
    },
    easeInOutBack: function(e, t, n, i, a, o) {
        return void 0 == o && (o = 1.70158),
        (t /= a / 2) < 1 ? i / 2 * (t * t * (((o *= 1.525) + 1) * t - o)) + n: i / 2 * ((t -= 2) * t * (((o *= 1.525) + 1) * t + o) + 2) + n
    },
    easeInBounce: function(e, t, n, i, a) {
        return i - jQuery.easing.easeOutBounce(e, a - t, 0, i, a) + n
    },
    easeOutBounce: function(e, t, n, i, a) {
        return (t /= a) < 1 / 2.75 ? i * (7.5625 * t * t) + n: 2 / 2.75 > t ? i * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + n: 2.5 / 2.75 > t ? i * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + n: i * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + n
    },
    easeInOutBounce: function(e, t, n, i, a) {
        return a / 2 > t ? .5 * jQuery.easing.easeInBounce(e, 2 * t, 0, i, a) + n: .5 * jQuery.easing.easeOutBounce(e, 2 * t - a, 0, i, a) + .5 * i + n
    }
});
var t2App = angular.module("t2App", ["ngRoute", "ngRetina", "apps.services", "apps.directives", "apps.filters", "t2.services", "t2.controllers", "templates", "ng-translation"]),
t2Services = angular.module("t2.services", []),
t2Controllers = angular.module("t2.controllers", []),
appsServices = angular.module("apps.services", ["ngCookies"]),
appsFilters = angular.module("apps.filters", []),
appsDirectives = angular.module("apps.directives", []),
isMobile = function() {
    var e = window.devicePixelRatio || 1;
    return $(window).width() <= 736 && (screen.width <= 736 || e >= 2)
};
t2App.config(["$routeProvider", "$locationProvider", "ngTranslationProvider",
function(e, t) {
    e.when("/overview", {
        templateUrl: function() {
            var e = "view/html/overview.html";
            return isMobile() && (e = "view/html/overview-mobile.html"),
            e
        },
        controller: "OverviewCtrl"
    }),
    e.otherwise({
        redirectTo: "/overview"
    }),
    t.html5Mode(!1)
}]),
t2App.run(["$rootScope", "PageScroll", "BlockImages", "Utils", "ngTranslation", "Language",
function(e, t, n, i, a, o) {
    o.init(),
    a.use(e.lang),
    e.$on("$routeChangeStart",
    function(i, a, o) {
        e.loading = !0,
        t.reset(),
        n.init(),
        $(".header").removeClass("header-t2-black"),
        $(".header-sub").removeClass("fixed header-dark")
    }),
    e.$on("$routeChangeSuccess",
    function(t, n, a) {
        e.loading = !1,
        i.setHeaderActive("t2")
    })
}]),
appsServices.factory("Utils", ["$rootScope", "$q", "$http", "$location", "$cookies",
function(e, t, n, i, a) {
    var o = {};
    return o.truncateChars = function(e, t, n, i) {
        if (e) {
            var a = e.replace(/[\u4e00-\u9fa5\s]/g, "**").length,
            o = [],
            r = 0;
            if (i) {
                var s = $("<div></div>").html(e);
                e = s.text(),
                s = null
            }
            if (t >= a) return e;
            for (var c = 0; a > c; c++) {
                var l = e.charAt(c);
                if (r += /[^\x00-\xff]/.test(l) ? 2 : 1, o.push(l), r >= t) break
            }
            return n ? o.join("") + "...": o.join("")
        }
        return ""
    },
    o.encodeUriQuery = function(e, t) {
        return encodeURIComponent(e).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, t ? "%20": "+")
    },
    o.toKeyValue = function(e) {
        var t = this,
        n = [];
        return angular.forEach(e,
        function(e, i) {
            angular.isArray(e) ? angular.forEach(e,
            function(e) {
                n.push(t.encodeUriQuery(i, !0) + (e === !0 ? "": "=" + t.encodeUriQuery(e, !0)))
            }) : n.push(t.encodeUriQuery(i, !0) + "=" + t.encodeUriQuery(e, !0))
        }),
        n.length ? n.join("&") : ""
    },
    o.shareWeibo = function(e, t, n, i, a) {
        var o = e || $(".share-btn"),
        r = null;
        r = a ? encodeURIComponent(a) : encodeURIComponent(location.href);
        var s = n || "",
        c = "",
        l = i || $(".share-weibo-cover").attr("src"),
        u = encodeURIComponent(this.truncateChars(s, 232, !0));
        c += "&title=" + u,
        c += "&url=" + r,
        l && (c += "&pic=" + encodeURIComponent(l)),
        o.attr("href", c)
    },
    o.setTitle = function(e, t) {
        "undefined" == typeof t ? document.title = e: document.title = e + " - " + t
    },
    o.setKeywords = function(e) {
        e && "" !== e && $("meta[name='keywords']").attr({
            content: e
        })
    },
    o.setDescription = function(e) {
        e && "" !== e && $("meta[name='description']").attr({
            content: e
        })
    },
    o.setMobileTitle = function(t) {
        var n = "";
        "undefined" == typeof t.text ? n = "en" == e.lang ? '<a href=""><span class="logo-pic"></span></a>': '<a href=""><span class="logo-pic"></span></a>': n += "undefined" == typeof t.url ? t.text: '<a href="' + t.url + '">' + t.text + "</a>",
        $(".mobile-title").html(n)
    },
    o.setCrumbs = function(e) {
        for (var t = "",
        n = 0; n < e.length; n++) t += "undefined" == typeof e[n].url ? e[n].title: '<a href="' + e[n].url + '">' + e[n].title + "</a>",
        n + 1 < e.length && (t += '<span class="arrow"></span>');
        $(".header-crumbs").length ? $(".header-crumbs").html(t) : $(".breadcrumb").html(t)
    },
    o.setT1Crumbs = function(e, t) {
        e && $(".header-sub .breadcrumb").removeClass("hide");
        var n = "";
        t && (n += '<h2 class="phone-logo"></h2>'),
        n += '<ul class="t1Crumbs">';
        for (var i = e.currentPage,
        a = 0; a < e.list.length; a++) {
            var o = "";
            i && e.list[a].url.indexOf(i) > 0 && (o = "on"),
            n = n + '<li class="' + o + '"><a href="' + e.list[a].url + '">' + e.list[a].title + "</a></li>"
        }
        n += "</ul>",
        $(".breadcrumb").html(n)
    },
    o.setTCrumbs = function(e, t, n) {
        e && $(".header-sub .breadcrumb").removeClass("hide");
        var i = "";
        n && (i += '<h2 class="device-logo"></h2>'),
        t || (t = "device-nav"),
        i += '<ul class="' + t + '">';
        for (var a = e.currentPage,
        o = 0; o < e.list.length; o++) {
            var r = "";
            a && e.list[o].url.indexOf(a) > 0 && (r = "active"),
            i = i + '<li class="' + r + '"><a href="' + e.list[o].url + '">' + e.list[o].title + "</a></li>"
        }
        i += "</ul>",
        $(".breadcrumb").html(i)
    },
    o.setTCrumbs = function(e, t, n) {
        e && $(".header-sub .breadcrumb").removeClass("hide");
        var i = "";
        n && (i += '<h2 class="os-logo"></h2>'),
        t || (t = "device-nav"),
        i += '<ul class="' + t + '">';
        for (var a = e.currentPage,
        o = 0; o < e.list.length; o++) {
            var r = "";
            a && e.list[o].url.indexOf(a) > 0 && (r = "active"),
            i = i + '<li class="' + r + '"><a href="' + e.list[o].url + '">' + e.list[o].title + "</a></li>"
        }
        i += "</ul>",
        $(".breadcrumb").html(i)
    },
    o.openServiceWindow = function() {
        if (this.isMobile()) _MEIQIA._SHOWPANEL({
            groupToken: "9aea609f9936e156d06f97654413fbb2"
        });
        else {
            var e = decodeURIComponent(""),
            t = $('<a><span id="meiqia-a"></span></a>');
            t.attr("href", e).attr("target", "_blank"),
            $("body").append(t),
            $("#meiqia-a").click()
        }
    },
    o.showMore = function(e, t) {
        var n = e.height(),
        i = e.find("h3").outerHeight() + e.find("ul").outerHeight();
        i > n && (t.css({
            display: "block"
        }), t.bind("click",
        function() {
            e.find(".feature-wrapper").css({
                height: "auto"
            }),
            t.hide()
        }))
    },
    o.isMobile = function() {
        var e = window.devicePixelRatio || 1;
        return $(window).width() <= 736 && (screen.width <= 736 || e >= 2)
    },
    o.isWeixin = function() {
        var e = navigator.userAgent.toLowerCase();
        return "micromessenger" == e.match(/MicroMessenger/i)
    },
    o.isMobileQQ = function() {
        var e = navigator.userAgent.toLowerCase();
        return "qq/" == e.match(/qq\//i)
    },
    o.isIphone = function() {
        var e = navigator.userAgent.toLowerCase();
        return "iphone" == e.match(/iphone/i)
    },
    o.isAndroid = function() {
        var e = navigator.userAgent.toLowerCase();
        return "android" == e.match(/android/i)
    },
    o.changeLangCookies = function(e) {
        var t = e.target.href,
        n = t.match(/(cn)+/i)[1];
        "" !== location.host && (e.preventDefault(), location.href.indexOf("lang=") < 0 ? location.href += "?lang=" + n: (location.href = location.href.replace(/\=(cn)+/,
        function(e) {
            return "=" + n
        }), setTimeout(function() {
            window.location.reload()
        },
        200))),
        -1 === t.indexOf("en") ? a.put("lang", "zh-CN", {
            path: "/",
            domain: ""
        }) : a.put("lang", "en-US", {
            path: "/",
            domain: ""
        })
    },
    o.setHeaderActive = function(t) {
        e.appHeader = t
    },
    o.getServerTime = function() {
        var e = t.defer(),
        n = "",
        i = null;
        return $.ajax({
            type: "get",
            dataType: "jsonp",
            url: n,
            success: function(t) {
                t && 0 == t.code && t.data.timestamp && (i = parseInt(t.data.timestamp)),
                e.resolve({
                    now: i
                })
            },
            error: function() {
                e.resolve({
                    now: null
                })
            }
        }),
        e.promise
    },
    o
}]),
appsServices.constant("Config", {
    baseUrl: "/index.php?r=",
    middlewareTestUrl: "",
    middlewareProUrl: "",
    storeUrlRest: "",
    mStoreUrlRest: "",
    headconfig: {
        headers: {
            "Content-Type": ";charset=utf-8"
        }
    },
    storeUrl: "",
    regExp: {
        isMobile: /^1[3|4|5|7|8]\d{9}$/,
        isMail: /^[\w.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}$/,
        isPassword: /^[\w\\\[\]\:\^\-~!@#$%&*()-+={}|;'",.\/<>?]{6,16}$/,
        isSafeUrl: /^(http|https)\:\/\/[a-zA-Z0-9\-\.]+\.(\b)(:[a-zA-Z0-9]*)?\/?([a-zA-Z0-9\-\._\?\,\'\/\\\+&amp;%\$#\=~])*$/,
        isIMEI: /^\d{15}$/,
        isMAC: /^([0-9a-fA-F]{2})(([\s:][0-9a-fA-F]{2}){5})$/,
        numOrEn: /^[0-9a-zA-Z]+$/,
        errorStr: /^[^\&\<\>]*$/
    },
    getDPR: function() {
        var e = window.devicePixelRatio,
        t = "1x";
        return e && (e > 1 && 2 >= e ? t = "2x": e > 2 && (t = "mobile")),
        t
    },
    getDomain: function() {
        return window.location.host.indexOf("") >= 0 ? "": "localhost"
    }
}).constant("ACCESS_LEVELS", {
    pub: 1,
    user: 2,
    cloud: 3,
    alpha: 4
}),
appsServices.factory("Message", ["$rootScope", "Account", "User", "BaseInfo", "$location",
function(e, t, n, i, a) {
    var o = function(o) {
        var r = o.originalEvent;
        r.origin == t.config.origin && ("isLoggedIn" == r.data && (i.update(), t.config.cartSync && ("-1" != a.path().indexOf("/cart") ? e.$broadcast("login", {
            name: "cart"
        }) : "-1" != a.path().indexOf("/accessories") ? e.$broadcast("login", {
            name: "accessories"
        }) : e.$broadcast("cart", {
            name: "syncList"
        }))), "isRegistered" == r.data && (i.update(), t.config.cartSync && ("-1" != a.path().indexOf("/cart") ? e.$broadcast("login", {
            name: "cart"
        }) : e.$broadcast("cart", {
            name: "syncList"
        }))), "isLoggedOut" == r.data && (t.close(), n.logout(), t.config.cartSync && (e.$broadcast("cart", {
            name: "removeCartAll"
        }), "-1" != a.path().indexOf("/cart") ? e.$broadcast("dialogClose", {
            name: "cart"
        }) : e.$broadcast("dialogClose", {
            name: "normal"
        }))), "dialogClose" == r.data && (t.close(), t.config.cartSync && ("-1" != a.path().indexOf("/cart") ? e.$broadcast("dialogClose", {
            name: "cart"
        }) : e.$broadcast("dialogClose", {
            name: "normal"
        }), e.$apply())))
    };
    return {
        handler: o
    }
}]),
appsServices.factory("Account", ["$window",
function(e) {
    var t = {},
    n = {
        wrapper: "body",
        origin: "",
        loginUrl: "",
        logoutUrl: "",
        registerUrl: "",
        iPadFixLoginUrl: "",
        iPadFixRegisterUrl: "",
        cartSync: !1
    },
    i = /iPad/i.test(e.navigator.userAgent),
    a = function() {
        var e = window.devicePixelRatio || 1;
        return $(window).width() <= 736 && (screen.width <= 736 || e >= 2)
    } (),
    o = function() {
        if (!t.wrapper) {
            var e = [];
            e.push('<div class="iframe-dialog" id="iframe-dialog">'),
            e.push('<div class="mask"></div>'),
            e.push('<iframe allowtransparency="true" src="" frameborder="0"></iframe>'),
            e.push("</div>"),
            t.wrapper = $(n.wrapper),
            t.wrapper.append(e.join(""))
        }
        t.mask = $("#iframe-dialog .mask"),
        t.iframe = $("#iframe-dialog iframe")
    },
    r = function(t) {
        var n = e.location.href;
        e.location.href = t + "?return_url=" + encodeURIComponent(n)
    },
    s = function(n, i) {
        if ("undefined" != typeof n) {
            o();
            var a = e.location.origin || e.location.protocol + "//" + e.location.hostname;
            t.iframe.attr("src", n + "?origin=" + a),
            i || (t.mask.show(), t.iframe.addClass("show"))
        }
    },
    c = function() {
        t.iframe && (t.mask.hide(), t.iframe.removeClass("show"), t.iframe.attr("src", ""))
    },
    l = function() {
        i || a ? r(n.iPadFixLoginUrl) : s(n.loginUrl)
    },
    u = function() {
        s(n.logoutUrl, !0)
    },
    d = function() {
        i || a ? r(n.iPadFixRegisterUrl) : s(n.registerUrl)
    },
    f = function(e) {
        n = angular.extend(n, e || {})
    };
    return {
        config: n,
        close: c,
        login: l,
        logout: u,
        register: d,
        set: f
    }
}]),
appsServices.factory("User", ["$rootScope", "$q", "$http", "$location", "Config", "ACCESS_LEVELS", "Utils",
function(e, t, n, i, a, o, r) {
    var s = {},
    c = !1,
    l = a.baseUrl;
    "-1" != location.href.indexOf("") && (l = a.storeUrlRest);
    var u = a.headconfig,
    d = function(t) {
        $.extend(s, t),
        c = !0,
        s.role > o.user ? e.isLoggedIn = !0 : e.isLoggedIn = !1
    },
    f = function() {
        var i = t.defer(),
        a = {};
        a.fields = "avatar_url,nickname,cellphone,t1_gift";
        var o = r.toKeyValue(a);
        return n.post(l + "Account/IsLogin", o, u).success(function(t) {
            0 == t.code ? (d(t.data), e.isLoggedIn = !0, i.resolve(t)) : (e.isLoggedIn = !1, i.reject(t))
        }).error(function() {
            i.reject("网络异常!")
        }),
        i.promise
    };
    return {
        getInfo: f,
        isInitial: function() {
            return c
        },
        isAuthorized: function(e) {
            return s && s.role >= e
        },
        set: d,
        isLoggedIn: function() {
            return !! s.uid
        },
        getUser: function() {
            return s
        },
        getId: function() {
            return s ? s.uid: null
        },
        getName: function() {
            return s.name || ""
        },
        getRole: function() {
            return s.role || null
        },
        getAvatarUrl: function() {
            return s.avatarUrl || ""
        },
        logout: function() {
            s = {},
            e.isLoggedIn = !1,
            e.$broadcast("logout"),
            e.$apply()
        }
    }
}]),
appsServices.factory("BaseInfo", ["$rootScope", "$q", "$cookies", "User", "Account", "Utils", "$timeout", "$location",
function(e, t, n, i, a, o, r, s) {
    var c = function() {
        var s = t.defer();
        return i.getInfo().then(function(t) {
            a.close(),
            e.loginUser = t.data,
            s.resolve();
            var i = !1;
            if (!o.isMobile() && 0 == t.code && t.data.t1_gift && parseInt(t.data.t1_gift) > 0 ? (r(function() {
                $(".header .account-panel .account-menu li.coupon").addClass("active")
            },
            1e3), i = !0) : $(".header .account-panel .account-menu li.coupon").removeClass("active"), a.config.cartSync) {
                var c = n.get("couponNotice");
                1 != c && i && r(function() {
                    var e = $(".main .notice-dialog");
                    e.length > 0 && (e.show().delay().toggleClass("on", !0), n.put("couponNotice", 1, {
                        domain: "",
                        path: "/"
                    }), e.find(".notice-close").on("click",
                    function(t) {
                        t.preventDefault(),
                        e.remove()
                    }))
                },
                200)
            }
        },
        function(e) {
            s.reject()
        }),
        s.promise
    };
    return {
        update: c
    }
}]),
appsServices.factory("Language", ["$rootScope", "$cookies", "$window", "$location",
function(e, t, n, i) {
    var a = window.location.pathname.match(/\/(cn)\//i),
    o = function() {
        a ? e.lang = a[1] : i.search().lang ? e.lang = i.search().lang: e.lang = "cn",
        e.langStatic = "cn" === e.lang ? "": e.lang + "/"
    };
    return {
        init: o
    }
}]),
appsServices.factory("Topbar", ["$timeout", "$rootScope",
function(e, t) {
    var n, i, a = {
        isWhiteBar: !1,
        topbarIsStore: !1,
        isBar: !1,
        prev: null,
        titleLabel: "",
        nextShow: !1,
        useCart: !0,
        cartNum: 0,
        useAccount: !0
    },
    o = {},
    r = !1;
    return {
        set: function(e) {
            if (!r) return void(i = e);
            o[n].topbar = angular.extend({},
            a, e ? e: {})
        },
        init: function(e) {
            var n = this;
            a = angular.extend(a, e ? e: {}),
            t.topbarIsStore = t.isMobile && !!a.topbarIsStore,
            n.set(e)
        },
        addDom: function(e, t, a) {
            var s = this;
            r = !0,
            domsMap = t,
            n = e || "topbar",
            o[n] = a,
            s.init(),
            i && (s.set(i), i = null)
        }
    }
}]),
appsDirectives.directive("changeLanguage", ["$document",
function(e) {
    return {
        restrict: "A",
        link: function(t, n, i, a) {
            n && (n.on("click",
            function(e) {
                var t = $(e.target).closest(".language-switch");
                return t.toggleClass("active"),
                !1
            }), e.on("click",
            function(e) {
                var t = $(e.target);
                t.closest(".language-switch").is(".language-switch") || $(".language-switch").removeClass("active")
            }))
        }
    }
}]).directive("mobileTopbar", ["$location", "Topbar",
function(e, t) {
    return {
        restrict: "EA",
        link: function(n, i, a, o) {
            i && (n.prevAction = function() {
                return angular.isFunction(n.topbar.prevFn) ? void n.topbar.prevFn() : void(n.topbar.prevIsBack && (history.length ? history.back( - 1) : e.url("/")))
            },
            t.addDom(a.name, i, n))
        }
    }
}]).directive("showWeixinCode", ["$document", "Utils",
function(e, t) {
    return {
        restrict: "A",
        link: function(e, t, n, i) {
            t && t.find("a").on("click",
            function() {
                var e = $(this).parent(".weixin"),
                t = e.find(".qrcode");
                if (t.is(":hidden")) {
                    e.addClass("hold");
                    var n = $(window).height() / 2;
                    t.css({
                        bottom: n + "px"
                    }),
                    t.fadeIn(100),
                    setTimeout(function() {
                        e.find(".mask").one("click",
                        function() {
                            e.removeClass("hold"),
                            t.fadeOut(300),
                            e.removeClass("hold")
                        }),
                        e.find(".close-btn").one("click",
                        function() {
                            e.removeClass("hold"),
                            t.fadeOut(300),
                            e.removeClass("hold")
                        })
                    })
                }
            })
        }
    }
}]).directive("openServiceWindow", ["$document", "Utils",
function(e, t) {
    return {
        restrict: "A",
        link: function(e, n, i, a) {
            n && n.on("click",
            function(e) {
                e.preventDefault(),
                t.openServiceWindow()
            })
        }
    }
}]).directive("mobileNavShow", ["$document",
function(e) {
    return {
        restrict: "A",
        link: function(e, t, n, i) {
            t && $(document).on("touchend", ".mobile-topbar .nav-toggle",
            function(e) {
                var t = e.originalEvent.changedTouches;
                return t && t.length && ($("html").toggleClass("mobile-noscroll"), $(".wrapper").removeClass("moblie-quick-nav"), $(".wrapper").toggleClass("moblie-show-nav")),
                !1
            })
        }
    }
}]).directive("mobileNavSticky", ["$document",
function(e) {
    return {
        restrict: "A",
        link: function(e, t, n, i) {}
    }
}]).directive("backTop", ["$document",
function(e) {
    return {
        restrict: "A",
        link: function(e, t, n, i) {
            t && ($(window).on("scroll",
            function() {
                $(window).scrollTop() > 600 ? t.addClass("active") : t.removeClass("active")
            }), t.on("click",
            function() {
                $("html,body").animate({
                    scrollTop: 51 == $("body").offset().top ? 0 : $("body").offset().top
                },
                {
                    queue: !1
                },
                500)
            }))
        }
    }
}]).directive("accountReservation", ["$document", "Utils",
function(e, t) {
    return {
        restrict: "A",
        link: function(e, n, i, a) {
            n && t.isMobile() && n.on("click",
            function() {
                $(this).hasClass("active") ? $(this).removeClass("active") : $(this).addClass("active")
            })
        }
    }
}]).directive("routeChangeResetHeader", [function() {
    return {
        restrict: "A",
        controller: ["$element", "$rootScope", "Utils",
        function(e, t, n) {
            t.$on("$routeChangeStart",
            function() {
                n.setMobileTitle({}),
                $(".wrapper").removeClass("moblie-show-nav"),
                $("html").removeClass("mobile-noscroll"),
                e.find(".header-sub .breadcrumb").removeClass("hide")
            })
        }]
    }
}]).directive("routeChangeResetFooter", [function() {
    return {
        restrict: "A",
        controller: ["$element", "$rootScope",
        function(e, t) {
            t.$on("$routeChangeStart",
            function() {
                e.find(".language-switch").removeClass("active")
            })
        }]
    }
}]).directive("setBuyBtnText", [function() {
    return {
        restrict: "A",
        controller: ["$element", "$location",
        function(e, t) {}]
    }
}]).directive("copyrightYear", [function() {
    return {
        restrict: "A",
        link: function(e, t, n, i) {
            var a = new Date,
            o = (a.getFullYear(), a.getMonth() + 1, 2016);
            $(t).html(o)
        }
    }
}]).directive("mobileDevice", ["Utils",
function(e) {
    return {
        restrict: "A",
        link: function(t, n, i, a) {
            var o = "";
            if (e.isMobile()) {
                var r = navigator.userAgent.toLowerCase(),
                s = "iphone os" == r.match(/iphone os/i),
                c = "android" == r.match(/android/i);
                s ? o = "device-iphone": c && (o = "device-android"),
                $(n).addClass(o),
                $("body").addClass(o)
            }
        }
    }
}]),
appsFilters.filter("to_HTML", ["$sce",
function(e) {
    return function(t) {
        return e.trustAsHtml(t)
    }
}]),
appsDirectives.directive("iRetinaVideo", ["$timeout", "Utils",
function(e, t) {
    return {
        restrict: "A",
        link: function(n, i, a, o) {
            function r() {
                return ! $("html").hasClass("csstransforms3d")
            }
            if (i) {
                var s = !!document.createElement("video").canPlayType,
                c = "ipad" == navigator.userAgent.toLowerCase().match(/ipad/i);
                if (c || !s || t.isMobile() || r()) return void i.remove();
                var l = window.devicePixelRatio || 1;
                e(function() {
                    var e = a.source;
                    l > 1 && (e = e.replace(".mp4", "@2x.mp4")),
                    i.append('<source src="' + e + '" type="video/mp4" />')
                },
                500)
            }
        }
    }
}]),
appsServices.factory("BlockImages", [function() {
    var e = $("body").blockImages();
    return {
        start: e.start,
        init: e.init
    }
}]),
t2Services.factory("PageScroll", [function() {
    var e = $(".wrapper").pageScroll({
        subNavClass: ".header-sub",
        minHeight: 620
    }),
    t = function(t) {
        e.setOptions(t)
    },
    n = function(t) {
        e.reset()
    },
    i = function() {
        e.init()
    };
    return {
        setOptions: t,
        reset: n,
        init: i
    }
}]),
t2Services.factory("SubNav", ["$window",
function(e) {
    var t = $(".header-main").height() + 20,
    n = $(".header-sub"),
    i = function() {
        $(window).off("scroll", a)
    },
    a = function() {
        var e = $(window).scrollTop();
        e > t ? n.addClass("active") : n.removeClass("active")
    },
    o = function() {
        i(),
        $(window).on("scroll", a)
    };
    return {
        reset: i,
        init: o
    }
}]),
t2Controllers.controller("MainCtrl", ["$rootScope", "$scope", "$window", "Account", "Message", "BaseInfo", "Utils",
function(e, t, n, i, a, o, r) {
    function s() {
        var e = navigator.userAgent.toLowerCase();
        return "windows" == e.match(/windows/i)
    }
    e.isT2 = 1,
    $(window).on("message", a.handler),
    t.$on("$viewContentLoaded",
    function(e) {
        $(".header").addClass("header-t2")
    }),
    s() && !r.isMobile() && (t.osClass = "os-windows"),
    o.update(),
    t.login = function() {
        o.update().then(function(t) {
            e.isLoggedIn = !0
        },
        function(e) {
            i.login()
        })
    },
    t.logout = function() {
        i.logout()
    },
    t.register = function() {
        i.register()
    },
    t.changeLangCookies = r.changeLangCookies
}]),
t2Controllers.controller("OverviewCtrl", ["$rootScope", "$scope", "$timeout", "PageScroll", "Utils", "BlockImages", "SubNav",
function(e, t, n, i, a, o, r) {
    var s, c, l, u, d = !1;
    if (!a.isMobile() && r.init(), !a.isMobile()) {
        $("html").hasClass("csstransforms3d") && setTimeout(function() {
            s = $(".canvas-one").spin(600),
            c = $(".canvas-two").spin(180),
            l = $(".canvas-three").spin(90),
            u = $(".canvas-four").spin(0)
        },
        100),
        setTimeout(function() {
            $(".overview .heros").addClass("t2-is-coming")
        },
        100),
        $(".overview .best .best-2").mouseover(function() {
            $(this).addClass("stop-animation")
        });
        var f, m = 0,
        p = function() {
            var e = $(".humanity .content p span");
            e.removeClass("active"),
            e.eq(m).addClass("active"),
            m = ++m % e.length,
            f = n(function() {
                p()
            },
            3e3)
        };
        t.$on("$locationChangeStart",
        function() {
            n.cancel(f)
        }),
        p();
        var v = function(e, t, n, i) {
            switch (e) {
            case 0:
                $(".overview .heros").removeClass("custom-active"),
                $(".overview .heros").addClass("custom-inactive");
                break;
            case 1:
                $(".overview .heros").removeClass("custom-inactive"),
                $(".overview .heros").addClass("custom-active");
                break;
            case 2:
                d || (d = !0, s.loadImage(), c.loadImage(), l.loadImage(), u.loadImage());
                break;
            case 4:
                m = 0
            }
        },
        g = function(e, t, n, i) {
            2 !== e && d && (s.spinPause(), c.spinPause(), l.spinPause(), u.spinPause())
        };
        "en" == e.lang ? ( i.init()) : (i.setOptions({
            paginationTip: ["", "明星产品", "定制蛋糕", "品牌故事","品牌阐释"],
            beforeMove: v,
            afterMove: g
        }), i.init())
    }
    o.start(),
     (a.setTitle("CAKEBOSS-高级蛋糕定制，甜品中心"), a.setTCrumbs({
        currentPage: "overview",
        list: [{
            url: "#",
            title: "CAKEBOSS · 记住我的爱",
            on: "true"
        }]
    },
    "", !0))
}]);

